# property修饰的方法名要与属性名一样
class Person:
    def __init__(self):
        self.__age: int = 18

    @property
    def age(self):
        return self.__age

    @age.setter
    def age(self, new_age):
        self.__age = new_age


p = Person()
print(f"修改前的年龄是：{p.age}")
p.age = 66
print(f"修改后的年龄是：{p.age}")

